#include "SudokuSolver.h"

static void displayGrid(const SudokuSolver& inGrid)
{
	for (int x = 1; x <= 9; x++)
	{
		for (int y = 1; y <= 9; y++)
		{
			int lValue = inGrid.getTileVal(x,y);
			if (lValue > 0)
				printf("%d ", lValue);
			else
				printf("_ ");
			if (y % 3 == 0)
		       printf("  ");
		}

		if (x % 3 == 0)
			printf("\n\n");
		else
			printf("\n");
	}
}
int main(void)
{
	SudokuSolver myGrid;

	// The following is based on the puzzle a the following URL:
	// http://www.websudoku.com/?level=4&set_id=8334573550
	myGrid.setTileVal(1, 5, 5);
	myGrid.setTileVal(1, 9, 4);
	myGrid.setTileVal(2, 9, 6);
	myGrid.setTileVal(3, 1, 8);
	myGrid.setTileVal(3, 2, 5);
	myGrid.setTileVal(3, 4, 3);
	myGrid.setTileVal(3, 8, 1);
	myGrid.setTileVal(4, 4, 2);
	myGrid.setTileVal(4, 6, 1);
	myGrid.setTileVal(4, 7, 6);
	myGrid.setTileVal(4, 8, 9);
	myGrid.setTileVal(5, 3, 3);
	myGrid.setTileVal(5, 5, 7);
	myGrid.setTileVal(5, 7, 8);
	myGrid.setTileVal(6, 2, 9);
	myGrid.setTileVal(6, 3, 7);
	myGrid.setTileVal(6, 4, 6);
	myGrid.setTileVal(6, 6, 8);
	myGrid.setTileVal(7, 2, 3);
	myGrid.setTileVal(7, 6, 7);
	myGrid.setTileVal(7, 8, 2);
	myGrid.setTileVal(7, 9, 5);
	myGrid.setTileVal(8, 1, 9);
	myGrid.setTileVal(9, 1, 6);
	myGrid.setTileVal(9, 5, 1);

	myGrid.Solve();
	displayGrid(myGrid);
	return 0;
}